options(rgl.useNULL=TRUE)

library(shiny)
library(shinyRGL)

# Define UI for application that plots random distributions
shinyUI(navbarPage(
h4('Análisis no paramétrico de convergencia'),

tabPanel(h5('Convergencia Sigma'),
         sidebarLayout(
             sidebarPanel(
                 
                 radioButtons("std1", h6("Estandarizar por"),
                              c("Media"="mean", "Mediana"="median","No estandarizar"=""),
                              selected='median'),                     
                 checkboxInput('log1',label='Transformación log',value=FALSE),
                 br(),
                 selectInput("var1", label=h6("Variable"),
                             c("TOTURB","TOTRURL","RESURB","RESRURL","COMERURB","COMERRURL", 
                               "INDUSURB","INDUSRURL","OURB","ORURL"),selectize=TRUE,
                             selected=c('TOTURB','TOTRURL'),multiple=TRUE)
             ),
             mainPanel(
                 
                 plotOutput("plot4",width=500,height=500)
                 
             )
         )         
),

tabPanel(h5('Kernel Estocástica'),
    sidebarLayout(
        sidebarPanel(width=3,
                     
                     
                     radioButtons("std", h6("Estandarizar por"),
                                  c("Media"="mean", "Mediana"="median","No estandarizar"=""),
                                  selected='median'),                     
                     checkboxInput('log',label='Transformación log',value=FALSE),
                     br(),                     
                     selectInput("var", label=h6("Variable"),
                                 c("TOTURB","TOTRURL","RESURB","RESRURL","COMERURB","COMERRURL", 
                                   "INDUSURB","INDUSRURL","OURB","ORURL"),selectize=TRUE,
                                 selected=c('TOTURB','TOTRURL'),multiple=TRUE),
                     br(),
                     sliderInput("year", label = HTML("<h6>A&#241;o</h6>"),
                                 min=1996,max=2012, value=c(1996,2012),step = 1)
                     
        ),                
        
        mainPanel(
            tabsetPanel(type='pills',
                tabPanel('Kernel Univariada',
                         plotOutput("plot1",width=500,height=500)
                ),
                tabPanel('Kernel Bivariada',                         
                         webGLOutput("plot2",width=500,height=500)                         
                ),
                tabPanel(
                    'Kernel Bivariada - Isógrama',
                    plotOutput("plot3",width=500,height=500)
                )
                
            )
        )
    )
)


))


